﻿@using NTQOnlineExam.Services.Infrastructure.MVC
@model NTQOnlineExamFrontend.Models.OrderHistoryDetailViewModel

@{
    ViewBag.Title = this.LocalResources("PageTitle");
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="table">
    <div class="col-sm-5">
        <table class="table  table-bordered">
            <tr>
                <td>
                    <label>@this.LocalResources("OrderId")</label>
                </td>
                <td>
                    @Model.Order.OrderUniqueId
                </td>
            </tr>
            <tr>
                <td>
                    <label>@this.LocalResources("SubTotal")</label>
                </td>
                <td>
                    @Model.Order.SubTotalDisplay
                </td>
            </tr>
            <tr>
                <td>
                    <label>@this.LocalResources("Status")</label>
                </td>
                <td>
                    @Model.Order.StatusDescription
                </td>
            </tr>
            <tr>
                <td>
                    <label>@this.LocalResources("CreationDate")</label>
                </td>
                <td>
                    @Model.Order.CreationDateDisplay
                </td>
            </tr>
           
        </table>
        <div class="controls">
            <button class="btn" onclick="backToHistory();" type="button">Back</button>
        </div>
    </div>
    <div class="col-sm-1">
    </div>
    <div class="col-sm-6">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>@this.LocalResources("TermId")</th>
                    <th>@this.LocalResources("TermName")</th>
                </tr>
            </thead>
            <tbody>
                @if (Model.Order.OrderDetails != null)
                {
                    foreach (var item in Model.Order.OrderDetails)
                    {
                    <tr>
                        <td>@item.TermId</td>
                        <td>@item.TermName</td>
                    </tr>
                    }
                }
            </tbody>
        </table>
    </div>
</div>


<script type="text/javascript">
    function backToHistory() {
        window.location.href = '@Url.RouteUrl(new { Controller = "Order", Action = "OrderHistory" })';

    };
</script>

